package com.lnsf.bookstore.system.permission.vo;

import com.lnsf.bookstore.system.model.vo.Tree;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

@Table(name="bs_permission")
public class Permission extends Tree {

    @Id
    private Integer id;

    /**
     * 权限名称
     */
    private String name;

    /**
     * 类型     0：目录   1：菜单   2：按钮
     */
    private Integer type;

    /**
     * 权限URL
     */
    private String url;

    /**
     * 权限编码，一级菜单为m01，二级为m0101，三级为m010101。现在的三级菜单可以理解为.do请求
     */
    private String code;

    @Column(name = "parent_id")
    private Integer parentId;

    @Column(name = "parent_ids")
    private String parentIds;

    /**
     * 菜单排序，数值越小越在前
     */
    private Integer sort;

    /**
     * 权限状态（1-在用，0-停用）
     */
    private Integer status;

    /**
     * 授权(多个用逗号分隔，如：vipuser:list,vipuser:create)
     */
    private String perms;

    /*@Transient
    private List<Permission> children;//扩展字段，存放下级菜单*/

    @Transient
    private String parentName;//扩展字段，存放上级菜单名字
    
    /*private Set<Role> roleSet = new HashSet<Role>(); */




    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }


    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }


    /*public List<Permission> getChildren() {
        return children;
    }

    public void setChildren(List<Permission> children) {
        this.children = children;
    }*/


    public String getParentName() {
        return parentName;
    }

    public void setParentName(String parentName) {
        this.parentName = parentName;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getParentId() {
        return parentId;
    }

    public void setParentId(Integer parentId) {
        this.parentId = parentId;
    }

    public String getParentIds() {
        return parentIds;
    }

    public void setParentIds(String parentIds) {
        this.parentIds = parentIds;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getPerms() {
        return perms;
    }

    public void setPerms(String perms) {
        this.perms = perms;
    }

    @Override
    public String toString() {
        return "Permission [id=" + id + ", name=" + name + ", type=" + type + ", url=" + url + ", code=" + code
                + ", parentId=" + parentId + ", parentIds=" + parentIds + ", sort=" + sort + ", status=" + status
                + "]";
    }

	/*public Set<Role> getRoleSet() {
		return roleSet;
	}

	public void setRoleSet(Set<Role> roleSet) {
		this.roleSet = roleSet;
	}*/

	
    
    
}